﻿using System.Data.Entity.ModelConfiguration;
using WarehouseSystem.Domain.Entities;

namespace WarehouseSystem.Repository.EntityConfigurations
{
    /// <summary>
    /// XXX实体映射配置
    /// </summary>
	public class StockDetailConfig : EntityTypeConfiguration<StockDetail>
	{
        /// <summary>
        /// 构造器
        /// </summary>
        public StockDetailConfig()
        {
            //在此处写Fluent API表达式
            this.HasOptional(x => x.CheckStock)
                .WithOptionalPrincipal(x => x.Detail)
                .Map(x => x.MapKey("Detail_Id"));
        }
	}
}
